In a computer system or a computer network, a port number identifies a sending or destination application. Every application running on a host computer system uses certain ports or ranges of ports to communicate with other applications running on other host computer systems. It is by these port numbers that a communication protocol, e.g., TCP (transmission control protocol) or UDP (user datagram protocol) determines which application to pass the data to in the application layer.
When an application on one computer system wants to communicate with an application on another computer system, it must specify the address of the device (IP address) and identify the application (port number). The combination of sending and destination port numbers and the sending and destination IP addresses defines a socket. A socket can be used to uniquely define a UDP or TCP connection.
Applications, e.g., Internet applications, were initially written to handle one or two sockets. Internet applications, e.g., Telnet, UDP, or TCP, etc., typically handle one or two sockets, and accordingly, handle one or two connections at a time. With each socket are associated socket calls. A socket call can be, but is not limited to, a call to read from the socket, a call to write to the socket, a call for error check on the socket, etc.
The proliferation of the Internet, and more particularly the World Wide Web, has caused, in part, the development of a web server, a type of computer system that is adapted to serve/handle numerous sockets. Many of today's current web servers can handle thousands of concurrent sockets/connections.
The socket calls are the same as those listed above, e.g., read, write, and error check, but instead of one or two sockets to handle, there are commonly hundreds if not thousands of sockets that can be simultaneously opened. This means that the application will check each of the sockets for read, write, and/or error check. Accordingly, applications use vast amounts of processing time performing socket calls on the thousands of sockets. Disadvantageously, other useful work or processes may not be performed while the Internet application is performing these thousands upon thousands of socket calls.
To overcome this drawback, system calls, e.g., select system call and poll system call, were developed to be able to inform the application, e.g., an Internet application, when it is permitted to read from a socket or permitted to write to a socket.
The system calls are not without drawbacks associated therewith. When a poll call or a select call was made, the kernel would go through every socket opened by the application in the poll or select call, locking and unlocking the socket and checking for events of interest. Because there can be hundreds, thousands, or tens of thousands of sockets and each socket is looked at, with some sockets having hold mechanism, this can also use large amounts of processing time.
Hence, many applications are not provided with efficient socket communication.